package cn.exrick.xboot.base.entity

import cn.exrick.xboot.core.base.XbootBaseEntity
import cn.exrick.xboot.core.base.XbootBaseEntityKt
import cn.exrick.xboot.core.common.utils.SnowFlakeUtil
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import io.swagger.annotations.ApiOperation
import org.hibernate.annotations.DynamicInsert
import org.hibernate.annotations.DynamicUpdate
import javax.persistence.Entity
import javax.persistence.Id
import javax.persistence.Table

/**
 * @author Fei
 */

@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "en_inform")
@TableName("en_inform")
@ApiModel(value = "通知")
data class Inform(

        @ApiModelProperty("标题")
        var title: String? = null,

        @ApiModelProperty("内容")
        var content: String? = null,

        @ApiModelProperty("通知类型1.所有人 2.指定人")
        var informType: Int? = null,

        @ApiModelProperty("是否已读")
        var isRead: Boolean? = false,

        @ApiModelProperty("接收消息的人的id")
        var informToUserId: String? = null

) : XbootBaseEntityKt() {

    @Id
    @TableId
    override var id: String = SnowFlakeUtil.nextId().toString()

    companion object {
        private const val serialVersionUID = 1L
    }
}